package cn.dengta.webapp.trade.entity;

import java.math.BigDecimal;
import java.util.Date;

import cn.dengta.webapp.base.entity.TimeBasedEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import me.codeplayer.util.X;

/**
 * 代理商详情表
 *
 * @author lgy
 * @since 2022-05-11
 */
@Setter
@Getter
@Accessors(chain = true)
@TableName("dt_agent_info")
public class AgentInfo extends TimeBasedEntity {

	/** 代理商ID */
	private Long agentId;
	/** 累计收入（元） */
	private BigDecimal incomeMoney;
	/** 保证金缴纳图片 */
	private String bondImg;
	/** 代理商证件照 */
	private String companyImg;

	@Override
	public void setId(Long id) {
		this.id = id;
	}

	public AgentInfo init(AgentInfo input, Date now) {
		this.agentId = X.expectNotNull(agentId, input.agentId);
		this.incomeMoney = X.expectNotNull(input.incomeMoney, incomeMoney, BigDecimal.ZERO);
		this.bondImg = X.expectNotNull(input.bondImg, bondImg);
		this.companyImg = X.expectNotNull(input.companyImg, companyImg);
		super.initTime(now);
		return this;
	}

	//
	public static final String AGENT_ID = "agent_id";
	public static final String INCOME_MONEY = "income_money";
	public static final String BOND_MONEY = "bond_money";
	public static final String BOND_IMG = "bond_img";
	public static final String COMPANY_IMG = "company_img";

}
